<template>
  <div>
    <el-table :data="brand.brandList" border style="width: 100%">
      <el-table-column prop="id" label="ID" min-width="80"></el-table-column>
      <el-table-column prop="name" label="品牌名称" min-width="80"></el-table-column>
      <el-table-column prop="floor_price" label="最低价" min-width="80"></el-table-column>
      <el-table-column prop="is_new" label="新品" min-width="80">
        <template slot-scope="scope">{{brand.brandList[scope.$index].is_new?'是':'否'}}</template>
      </el-table-column>

      <el-table-column label="显示" min-width="80">
        <template slot-scope="scope">{{brand.brandList[scope.$index].is_show?'是':'否'}}</template>
      </el-table-column>

      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            @click="deletelist(scope.$index,brand.brandList[scope.$index].id)"
            type="primary"
            size="small"
          >编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
//引入vuex
import { mapState } from "vuex";

export default {
  computed: {
    ...mapState(["brand"])
  },
  //   方法
  methods: {
    deletelist(e, id) {
      console.log(e, id);
      this.$router.push({
        path: `/editbrand/${id}`,
        params: {
          id
        }
      });
    }
  }
};
</script>

<style>
</style>